<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="f"  uri="http://java.sun.com/jsf/core"%>
<%@ taglib prefix="h"  uri="http://java.sun.com/jsf/html"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Agenda de Contatos</title>
</head>
<body>
<f:view>
	<h:form>
		<h:outputText value="Nome: "/>
		<h:inputText value="#{agendaContatoBean.contato.nome}" id="txtContatoNome"/><br/>
		
		<h:outputText value="Endereço: "/>
		<h:inputText value="#{agendaContatoBean.contato.endereco}" id="txtContatoEndereco"/><br/>
		
		<h:outputText value="Sexo: "/>
		<h:inputText value="#{agendaContatoBean.contato.sexo}" id="txtContatoSexo"/><br/>
		
		<h:commandButton actionListener="#{agendaContatoBean.incluirContato}" value="Incluir" id="btnIncluir"/>
		
		<p/>
		<h:dataTable var="objContato" value="#{agendaContatoBean.contatos}" border="1" width="100%" id="tblContatos">
			<h:column>
				<f:facet name="header">
					<h:outputText value="Nome"/>
				</f:facet>
				<h:outputText value="#{objContato.nome}"/>
			</h:column>
			
			<h:column>
				<f:facet name="header">
					<h:outputText value="Endereço"/>
				</f:facet>
				<h:outputText value="#{objContato.endereco}"/>
			</h:column>
			
			<h:column>
				<f:facet name="header">
					<h:outputText value="Sexo"/>
				</f:facet>
				<h:outputText value="#{objContato.sexo}"/>
			</h:column>						
		</h:dataTable>		
	</h:form>
</f:view>
</body>
</html>